#include <iostream>
#include<set>

using namespace std;
typedef int type;
/**
 * @brief 自定义set的排序方式，绝对值大的排前面
 */
template <typename T>
class m_compare
{
public:
    bool operator()(const T &x1, const T &x2) const
    {

        return x1 * x1 > x2 * x2;
    }
};

int main()
{ 
  
    type nums[] = {1, 3, 5, 7, 9, -1, -4, -5, 1, 3, 5};
    //不会去重，底层调用函数不一样
    multiset<type,m_compare<type>> mset(nums, nums + sizeof(nums) / sizeof(type));
    for (type i : mset)
    {
        cout << i << ",";
    }
    cout << endl
         << "hello" << endl;
}
